using UnityEngine;
using UnityEngine.UI;

public class TopBarTip : MonoBehaviour
{
	private Animator m_Animator;

	[SerializeField]
	private Text m_Text;

	private void Awake()
	{
		m_Animator = GetComponent<Animator>();
		m_Animator.SetTrigger("Show");
	}

	private void _Show(string text)
	{
		m_Text.text = text;
	}

	public static void Show(string text)
	{
		if (!GameManager.CurrentUIRoot.transform.Find("TopBar"))
		{
			TopBarTip topBarTip = SupportTools.AddChild<TopBarTip>(GameManager.CurrentUIRoot.gameObject, "UI/AchieveTopBar");
			topBarTip._Show(text);
			topBarTip.name = "TopBar";
		}
	}

	public static void Show(int id)
	{
		Show(HOLocalizationConfiguration.GetValue(id));
	}
}
